#include "StdAfx.h"
#include "AnimationRotateMerrySpin.h"
#include "math.h"
#define Pi  std::atan(1.0)*4
CAnimationRotateMerrySpin::CAnimationRotateMerrySpin(void)
{
	m_time=0;
	m_degree=0;
}

CAnimationRotateMerrySpin::~CAnimationRotateMerrySpin(void)
{
}

void CAnimationRotateMerrySpin::Update(){
	m_time++;
	m_time= m_time%600;

	if((m_time >= 0) && (m_time < 10))
	{
		m_degree = 0.0;
	}
	else if(m_time<300)
		m_degree+=Pi/72;
	else if(m_time>=300)
		m_degree-=Pi/72;
	m_node->SetAngle(m_node->GetAngle() - m_degree);
}
